package com.sl.au.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.AfterSaleTicketAdvice;

public interface AfterSaleTicketAdviceRepository extends JpaRepository<AfterSaleTicketAdvice, String> {
	@Query("select a from AfterSaleTicketAdvice a where a.afterSaleTicket.id=?1")
	AfterSaleTicketAdvice findByTicketId(String ticketId);

	// 删除与售后服务单相关的返厂维修处理意见和三包办理明细
	@Transactional
	@Modifying
	@Query("delete from AfterSaleTicketAdvice a where a.afterSaleTicket.id=?1 ")
	public void deleteAdvice(String id);
}
